<?php
/**
 * Created by PhpStorm.
 * User: ZT
 * Date: 2020/7/8 0008
 * Time: 13:51
 **/

namespace backend\controllers;
use backend\component\BackendBaseController;
use backend\component\ResultFormat;
use backend\service\CommentService;
use backend\service\TagService;
use common\models\info\Comment;
use common\utils\CommonUtil;
use common\models\info\Tags;
use common\models\info\TagsRelation;
use frontend\service\TravelService;


class CommentController extends BackendBaseController
{
    public function actions()
    {
        return [
            "modify" => [
                'class' => "backend\actions\ModifyAction",
                'modelName' => Comment::className(),
            ],
            "delete" => [
                'class' => "backend\actions\DeleteAction",
                'modelName' => Comment::className(),
                'is_physics' => true
            ],
        ];
    }

    /*
     * 标签列表
     */
    public function actionList()
    {
        $data = CommentService::CommentList(\Yii::$app->request->get());
        return ResultFormat::success('SUCCESS', $data);
    }
    public function actionReply(){
               $model = Comment::modelById(0);
        return ResultFormat::success('SUCCESS',$model->attributes);
    }
}